package com.example.mybatisplusdemo.leetcode;

import java.util.LinkedHashMap;
import java.util.LinkedList;

/**
 * @author Keson
 * @version 1.0
 * @description: TODO
 * @date 2021/6/24 20:55
 */
public class Test {

    public static void main(String[] args) {
        System.out.println(isPalindrome(1));
    }

    public static boolean isPalindrome(int x) {
        boolean flag = false;
        if (x >= 0 && x <= 9) flag=true ;
        if (x>0){
            char[] chars = String.valueOf(x).toCharArray();
            int len = chars.length;
            for(int i = 0;i < len/2;i++){
                if (chars[i] == chars[len-i-1]) flag=true;
            }
        }
        return flag;
    }
}
